import 'package:backend.core/core/domain/entities/web/web_bank_card_type.dart';
import 'package:backend.purchases/domain/entities/yookassa_api/payments/yookassa_api_bank_card_type.dart';

abstract class CreateWebBankCardTypeFromYookassaApiOne {
  WebBankCardType call({
    required YookassaApiBankCardType yookassaApiBankCardType,
  });
}

class CreateWebBankCardTypeFromYookassaApiOneImpl
    implements CreateWebBankCardTypeFromYookassaApiOne {
  const CreateWebBankCardTypeFromYookassaApiOneImpl();

  @override
  WebBankCardType call({
    required YookassaApiBankCardType yookassaApiBankCardType,
  }) {
    switch (yookassaApiBankCardType) {
      case YookassaApiBankCardType.visa:
        return WebBankCardType.visa;
      case YookassaApiBankCardType.mastercard:
        return WebBankCardType.mastercard;
      case YookassaApiBankCardType.mir:
        return WebBankCardType.mir;
      case YookassaApiBankCardType.unionPay:
        return WebBankCardType.unionPay;
      case YookassaApiBankCardType.jcb:
        return WebBankCardType.jcb;
      case YookassaApiBankCardType.americanExpress:
        return WebBankCardType.americanExpress;
      case YookassaApiBankCardType.dinersClub:
        return WebBankCardType.dinersClub;
      case YookassaApiBankCardType.discoverCard:
        return WebBankCardType.discoverCard;
      case YookassaApiBankCardType.instaPayment:
        return WebBankCardType.instaPayment;
      case YookassaApiBankCardType.instaPaymentTM:
        return WebBankCardType.instaPaymentTM;
      case YookassaApiBankCardType.laser:
        return WebBankCardType.laser;
      case YookassaApiBankCardType.dankort:
        return WebBankCardType.dankort;
      case YookassaApiBankCardType.solo:
        return WebBankCardType.solo;
      case YookassaApiBankCardType.switchCard:
        return WebBankCardType.switchCard;
      case YookassaApiBankCardType.unknown:
        return WebBankCardType.unknown;
    }
  }
}
